<template>
  <div class="live-header">
    <div class="title">{{ title }}</div>
    <MainSearch
      v-if="showSearch"
      :placeholder="placeholder"
      @inputChange="inputChange"
    />
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import MainSearch from './main-search.vue'

export default defineComponent({
  components: { MainSearch },
  props: {
    title: String,
    placeholder: String,
    showSearch: {
      type: Boolean,
      default: true,
    },
  },
  setup(props, { emit }) {
    const inputChange = (item: any) => {
      emit('inputChange', item)
    }
    return { inputChange }
  },
})
</script>

<style lang="less" scoped>
.live-header {
  display: flex;
  justify-content: space-between;
  margin: 0 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  .title {
    font-size: 19px;
  }
}
</style>
